package cn.moukou.tongji.ihealth.patient.schdule;

import cn.moukou.tongji.ihealth.patient.service.PatientReserveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.Date;

@Component
public class ReserveSchedule {

    @Autowired
    PatientReserveService patientReserveService;

    @Scheduled(cron = "0 15 0 ? * *")
    public void updateReserveDate() {
        Date date = new Date();
        java.sql.Date sqlDate = new java.sql.Date(date.getTime());
        patientReserveService.updateState();
        System.out.println("过期更新");
    }
}
